retagged by
13,302 views
47 47 votes

Match all items in Group 1 with the correct options from those given in Group 2.$$\begin{array}{|ll|ll|}\hline \rlap{\textbf{Group 1}} & & \rlap{\textbf{Group 2}}  \\\hline \text{P.} & \text{Regular Expression} & \text{1.} & \text{Syntax analysis} \\\hline  \text{Q.} & \text{Pushdown automata} & \text{2.}& \text{Code generation} \\\hline   \text{R.}& \text{Dataflow analysis} & \text{3.}  & \text{Lexical analysis} \\\hline  \text{S.} & \text{Register allocation} &\text{4.}  & \text{Code optimization}  \\\hline \end{array}$$

  1. $\text{P-4, Q-1, R-2, S-3}$
  2. $\text{P-3, Q-1, R-4, S-2}$
  3. $\text{P-3, Q-4, R-1, S-2}$
  4. $\text{P-2, Q-1, R-4, S-3}$

3 Answers

Best answer
62 62 votes

Correct Option: B

Regular expressions are used in lexical analysis.

Pushdown automata is related to context free grammar which is related to syntax analysis.

Dataflow analysis is done in code optimization.

Register allocation is done in code generation.

edited by
2 2 votes

1.lexer understand codes of a programme and lexer uses pattern to generate token
now pattern are expressed by regular expression ir L(L+D)* for recognizing keywords .
2.we use grammars to define syntax of a programme how lets see
   a + b * c  this is our expression in one c programme
  now related cfg is 
    E → E + T | T
    T → T * F | F
    F → (E) | id
 now with this grammar help we generate syntax tree or called derivation tree
so grammars are well knows for synatx tree 
remember syntax tree are also one form of intermeditate code which is source language depenedent machine code
and obviously we use PDA to accept CFG
 

3.code optimization has basically two parts
  data flow analysis and control flow analysis
data flow analysis does what-its concerned with how  data flows and this analysis helps us to 
subparts of data flow analysis is

Live Variable Analysis
 
for register allocation and dead code elimination

Available Expressions Analysis
  
common subexpression elimination and copy propogation

Constant Propagation Analysis
note:
Register allocation is also part of optimization i dont know how it helps in code generation


 

1 1 vote
Group1Group2
P. Regular Expression3. Lexical analysis
Q. Pushdown automata1. Syntax analysis
R. Dataflow analysis4. Code optimization
S. Register allocation2. Code generation

Answer : B

Answer:
Position:
Show:

Related questions

21 21 votes
6 6 answers
12.0k
12.0k views
Arjun asked Feb 16, 2024
12,032 views
​​​Consider the following two sets:$$\begin{array}{|ll|ll|}\hline & \textbf{Set X} & & \textbf{Set Y} \\\hline \text{ P.} & \text{Lexical Analyzer } & \text{1.}& \text...
50 50 votes
5 answers 5 answers
16.2k
16.2k views
Madhav asked Feb 14, 2017
16,158 views
Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it:$$\begin{array}{|l|l|}\hline \text{P. Syntax t...
33 33 votes
1 answers 1 answer
8.4k
8.4k views
Akash Kanase asked Feb 12, 2016
8,417 views
Match the following:$$\begin{array}{|ll|ll|}\hline \text{(P)} & \text{Lexical analysis} & \text{(i)} & \text{Leftmost derivation} \\\hline \text{(Q)} & \text{Top down pa...